import heapq
from typing import List


class Solution:
    def minOperations(self, nums: List[int], k: int) -> int:
        if min(nums) >=k:
            return 0
        n=len(nums)
        h=[nums[i] for i in range(n)]
        heapq.heapify(h)
        ans=0
        while h[0]<k :
            ans+=1
            x=heapq.heappop(h)
            y=heapq.heappop(h)
            heapq.heappush(h,x*2+y)

        return ans